package com.lucky.tjs.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author TJS
 * @Description
 * 注册中心配置:
 *   用于注册和协调作业分布式行为的组件，目前仅支持 ZooKeeper。
 *   类名称：org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration
 *
 *   配置：
 *   构造器注入：
 *        serverLists                 zk(集群)IP:port
 *        namespace                   命名空间
 *
 *    set注入：
 *        baseSleepTimeMilliseconds       默认：1000  等待重试的间隔时间的初始毫秒数
 *        maxSleepTimeMilliseconds        默认：3000  等待重试的间隔时间的最大毫秒数
 *        maxRetries                      默认：3           最大重试次数
 *        sessionTimeoutMilliseconds      默认：60000        会话超时毫秒数
 *        connectionTimeoutMilliseconds   默认：15000        连接超时毫秒数
 *        digest（String)                 无需验证            连接 ZooKeeper 的权限令牌
 * @create 2023/5/12 6:34
 */
@Component
@ConfigurationProperties(prefix = "regcenter")
public class ZkConfigProperties {

    private String serverList;

    private String namespace;

    private Integer baseSleepTimeMilliseconds = 1000;

    private Integer maxSleepTimeMilliseconds = 3000;

    private Integer maxRetries = 3;

    private Integer sessionTimeoutMilliseconds = 60000;

    private Integer connectionTimeoutMilliseconds = 15000;

    private String digest;

    public String getServerList() {
        return serverList;
    }

    public void setServerList(String serverList) {
        this.serverList = serverList;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public Integer getBaseSleepTimeMilliseconds() {
        return baseSleepTimeMilliseconds;
    }

    public void setBaseSleepTimeMilliseconds(Integer baseSleepTimeMilliseconds) {
        this.baseSleepTimeMilliseconds = baseSleepTimeMilliseconds;
    }

    public Integer getMaxSleepTimeMilliseconds() {
        return maxSleepTimeMilliseconds;
    }

    public void setMaxSleepTimeMilliseconds(Integer maxSleepTimeMilliseconds) {
        this.maxSleepTimeMilliseconds = maxSleepTimeMilliseconds;
    }

    public Integer getMaxRetries() {
        return maxRetries;
    }

    public void setMaxRetries(Integer maxRetries) {
        this.maxRetries = maxRetries;
    }

    public Integer getSessionTimeoutMilliseconds() {
        return sessionTimeoutMilliseconds;
    }

    public void setSessionTimeoutMilliseconds(Integer sessionTimeoutMilliseconds) {
        this.sessionTimeoutMilliseconds = sessionTimeoutMilliseconds;
    }

    public Integer getConnectionTimeoutMilliseconds() {
        return connectionTimeoutMilliseconds;
    }

    public void setConnectionTimeoutMilliseconds(Integer connectionTimeoutMilliseconds) {
        this.connectionTimeoutMilliseconds = connectionTimeoutMilliseconds;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }
}
